// 基于template/src/widgets/{{appEntities}}/{{ctrls@FORM}}-form/{{spinalCase ctrl.codeName}}-form-model.ts.hbs生成
import { IEditFormModel, IFormStore, IParam } from '@/core';
function getModel(): IEditFormModel {
    return {
        name: "form",
        caption: "",
        codeName: "RulesForm",
        enableAutoSave: false,
        entityCodeName: "IBIZBOOK",
        keyPSAppDEField: "IBIZBOOKId",
        majorPSAppDEField: "IBIZBOOKName",
        cssName: "",
        controlType: "FORM",
        formStyle: "",
        valueRule: getValueRule(),
        createDefaultItems: getCreateDefaultItems(),
        updateDefaultItems: getUpdateDefaultItems(),
        detailModel: getDetailModel(),
        ctrlMsgModel:[
    ],
        uiEngineModel: [
            {
                name: 'engine_form',
                triggerType: 'CTRLEVENT',
                logicType: 'APPVIEWENGINE',
                eventNames: 'LOAD;SAVE;REMOVE',
                scriptCode: ``,
                entityCodeName: '',
                logicName:``
            }
    ]
    }
}
function getValueRule() {
    return [
        {
            name: "press",
            valueRuleType: "DEFVALUERULE",
            checkMode: 3,
            ruleInfo: "必须右包含出版社",
            condition:  {
    "condOp": "AND",
    "notMode": false,
    "condType": "GROUP",
    "ruleInfo": "必须右包含出版社",
    "keyCond": false,
    "conditions": [
        {
            "condOp": "RIGHTLIKE",
            "notMode": false,
            "condType": "SIMPLE",
            "ruleInfo": "必须右包含出版社",
            "keyCond": false,
            "paramType": "",
            "paramValue": "出版社",
        }
    
    ]
}
        },
        {
            name: "returntime",
            valueRuleType: "DEFVALUERULE",
            checkMode: 3,
            ruleInfo: "(还书时间必须大于借出时间 并且 还书时间必须大于当前时间)",
            condition:  {
    "condOp": "AND",
    "notMode": false,
    "condType": "GROUP",
    "ruleInfo": "(还书时间必须大于借出时间 并且 还书时间必须大于当前时间)",
    "keyCond": false,
    "conditions": [
        {
            "condOp": "AND",
            "notMode": false,
            "condType": "GROUP",
            "ruleInfo": "(还书时间必须大于借出时间 并且 还书时间必须大于当前时间)",
            "keyCond": false,
            "conditions": [
                {
                    "condOp": "GT",
                    "notMode": false,
                    "condType": "SIMPLE",
                    "ruleInfo": "还书时间必须大于借出时间",
                    "keyCond": false,
                    "paramType": "ENTITYFIELD",
                    "paramValue": "LENDOUTTIME",
                }
            ,
                {
                    "condOp": "GT",
                    "notMode": false,
                    "condType": "SIMPLE",
                    "ruleInfo": "还书时间必须大于当前时间",
                    "keyCond": false,
                    "paramType": "CURTIME",
                    "paramValue": "",
                }
            
            ]
        }
    
    ]
}
        },
        {
            name: "lendouttime",
            valueRuleType: "DEFVALUERULE",
            checkMode: 3,
            ruleInfo: "需要大于当前时间",
            condition:  {
    "condOp": "AND",
    "notMode": false,
    "condType": "GROUP",
    "ruleInfo": "需要大于当前时间",
    "keyCond": false,
    "conditions": [
        {
            "condOp": "GT",
            "notMode": false,
            "condType": "SIMPLE",
            "ruleInfo": "需要大于当前时间",
            "keyCond": false,
            "paramType": "CURTIME",
            "paramValue": "",
        }
    
    ]
}
        },
        {
            name: "price",
            valueRuleType: "DEFVALUERULE",
            checkMode: 3,
            ruleInfo: "数值必须大于[0.0]且小于等于[100.0]",
            condition:  {
    "condOp": "AND",
    "notMode": false,
    "condType": "GROUP",
    "ruleInfo": "数值必须大于[0.0]且小于等于[100.0]",
    "keyCond": false,
    "conditions": [
        {
            "notMode": false,
            "condType": "VALUERANGE2",
            "ruleInfo": "数值必须大于[0.0]且小于等于[100.0]",
            "keyCond": false,
            "includeMinValue": false,
            "minValue": "0",
            "includeMaxValue": true,
            "maxValue": "100",
        }
    
    ]
}
        },
        {
            name: "type",
            valueRuleType: "DEFVALUERULE",
            checkMode: 3,
            ruleInfo: "内容长度必须大于[0]且小于等于[6]",
            condition:  {
    "condOp": "AND",
    "notMode": false,
    "condType": "GROUP",
    "ruleInfo": "内容长度必须大于[0]且小于等于[6]",
    "keyCond": false,
    "conditions": [
        {
            "notMode": false,
            "condType": "STRINGLENGTH",
            "ruleInfo": "内容长度必须大于[0]且小于等于[6]",
            "keyCond": false,
            "includeMinValue": false,
            "minValue": "0",
            "includeMaxValue": true,
            "maxValue": "6",
        }
    
    ]
}
        },
        {
            name: "author",
            valueRuleType: "SYSVALUERULE",
            checkMode: 3,
            regExCode: new RegExp("[A-Z]+"),
            ruleInfo: "内容必须由26个英文字母的大写组成的字符串",
            ruleType: "REG",
            scriptCode: ``
        }
    ]
}

function getCreateDefaultItems() {
    return [
    ]
}

function getUpdateDefaultItems() {
    return [
    ]
}
function getDetailModel() {
    return {
        formpage1: {
            caption: "基本信息",
            captionItemName: "",
            name: "formpage1",
            codeName: "formpage1",
            disabled: false, 
            visible: true,
            detailStyle: "DEFAULT",
            detailType: "FORMPAGE",
            showCaption: false,
            enableAnchor: false,
            showMoreMode: 0,
        },
        group1: {
            caption: "系统值规则",
            captionItemName: "",
            name: "group1",
            codeName: "group1",
            disabled: false, 
            visible: true,
            detailStyle: "DEFAULT",
            detailType: "GROUPPANEL",
            showCaption: true,
            enableAnchor: false,
            showMoreMode: 0,
            showMoreItems: [
            ],
        },
        ibizbookname: {
            caption: "非空",
            captionItemName: "",
            name: "ibizbookname",
            codeName: "ibizbookname",
            disabled: false, 
            visible: true,
            detailStyle: "DEFAULT",
            detailType: "FORMITEM",
            showCaption: true,
            enableAnchor: false,
            showMoreMode: 0,
            valueFormat: "",
            fieldCodeName: "IBIZBOOKName",
            dataType: "25",
            required: true,
            enableCond: 3,
            ignoreInput: 0,
            convertToCodeItemText: false,
            layout:{parentLayout: 'TABLE_24COL',colLG: 12,colMD: 12,colSM: 12,colXS: 12,},
        },
        author: {
            caption: "包含大写字母",
            captionItemName: "",
            name: "author",
            codeName: "author",
            disabled: false, 
            visible: true,
            detailStyle: "DEFAULT",
            detailType: "FORMITEM",
            showCaption: true,
            enableAnchor: false,
            showMoreMode: 0,
            valueFormat: "",
            fieldCodeName: "Author",
            dataType: "25",
            required: false,
            enableCond: 3,
            ignoreInput: 0,
            convertToCodeItemText: false,
            layout:{parentLayout: 'TABLE_24COL',colLG: 12,colMD: 12,colSM: 12,colXS: 12,},
        },
        ibizbookid: {
            caption: "图书标识",
            captionItemName: "",
            name: "ibizbookid",
            codeName: "ibizbookid",
            disabled: false, 
            visible: true,
            detailStyle: "DEFAULT",
            detailType: "FORMITEM",
            showCaption: true,
            enableAnchor: false,
            showMoreMode: 0,
            valueFormat: "",
            fieldCodeName: "IBIZBOOKId",
            dataType: "25",
            required: false,
            enableCond: 3,
            ignoreInput: 0,
            convertToCodeItemText: false,
            layout:{parentLayout: 'TABLE_24COL',colMD: 24,},
        },
        grouppanel1: {
            caption: "属性值规则",
            captionItemName: "",
            name: "grouppanel1",
            codeName: "grouppanel1",
            disabled: false, 
            visible: true,
            detailStyle: "DEFAULT",
            detailType: "GROUPPANEL",
            showCaption: true,
            enableAnchor: false,
            showMoreMode: 0,
            showMoreItems: [
            ],
        },
        price: {
            caption: "数值范围",
            captionItemName: "",
            name: "price",
            codeName: "price",
            disabled: false, 
            visible: true,
            detailStyle: "DEFAULT",
            detailType: "FORMITEM",
            showCaption: true,
            enableAnchor: false,
            showMoreMode: 0,
            valueFormat: "",
            fieldCodeName: "Price",
            dataType: "7",
            required: false,
            enableCond: 3,
            ignoreInput: 0,
            convertToCodeItemText: false,
            layout:{parentLayout: 'TABLE_24COL',colLG: 12,colMD: 12,colSM: 12,colXS: 12,},
        },
        type: {
            caption: "字符长度",
            captionItemName: "",
            name: "type",
            codeName: "type",
            disabled: false, 
            visible: true,
            detailStyle: "DEFAULT",
            detailType: "FORMITEM",
            showCaption: true,
            enableAnchor: false,
            showMoreMode: 0,
            valueFormat: "",
            fieldCodeName: "Type",
            dataType: "25",
            required: false,
            enableCond: 3,
            ignoreInput: 3,
            convertToCodeItemText: true,
            layout:{parentLayout: 'TABLE_24COL',colLG: 12,colMD: 12,colSM: 12,colXS: 12,},
        },
        press: {
            caption: "右包含",
            captionItemName: "",
            name: "press",
            codeName: "press",
            disabled: false, 
            visible: true,
            detailStyle: "DEFAULT",
            detailType: "FORMITEM",
            showCaption: true,
            enableAnchor: false,
            showMoreMode: 0,
            valueFormat: "",
            fieldCodeName: "Press",
            dataType: "25",
            required: false,
            enableCond: 3,
            ignoreInput: 0,
            convertToCodeItemText: false,
            layout:{parentLayout: 'TABLE_24COL',colLG: 12,colMD: 12,colSM: 12,colXS: 12,},
        },
        lendouttime: {
            caption: "大于当前时间",
            captionItemName: "",
            name: "lendouttime",
            codeName: "lendouttime",
            disabled: false, 
            visible: true,
            detailStyle: "DEFAULT",
            detailType: "FORMITEM",
            showCaption: true,
            enableAnchor: false,
            showMoreMode: 0,
            valueFormat: "YYYY-MM-DD",
            fieldCodeName: "Lendouttime",
            dataType: "5",
            required: true,
            enableCond: 3,
            ignoreInput: 0,
            convertToCodeItemText: false,
            editRules: {
                editorType: 'DATEPICKEREX_NOTIME',
            },
            layout:{parentLayout: 'TABLE_24COL',colLG: 12,colMD: 12,colSM: 12,colXS: 12,},
        },
        returntime: {
            caption: "规则组",
            captionItemName: "",
            name: "returntime",
            codeName: "returntime",
            disabled: false, 
            visible: true,
            detailStyle: "DEFAULT",
            detailType: "FORMITEM",
            showCaption: true,
            enableAnchor: false,
            showMoreMode: 0,
            valueFormat: "YYYY-MM-DD",
            fieldCodeName: "Returntime",
            dataType: "5",
            required: true,
            enableCond: 3,
            ignoreInput: 0,
            convertToCodeItemText: false,
            editRules: {
                editorType: 'DATEPICKEREX_NOTIME',
            },
            layout:{parentLayout: 'TABLE_24COL',colLG: 12,colMD: 12,colSM: 12,colXS: 12,},
        },
    }
}
export const model = getModel();
